<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.tjsinfo.tjsoa.common.DealString"%>
<%@ page import="com.tjsinfo.tjsoa.common.PaginationSupport"%>
<%@page import="com.tjsinfo.tjsoa.vote.vo.TVoteEstimated"%>
<%@page import="com.tjsinfo.tjsoa.vote.vo.TVoteConformation;"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	DealString ds = new DealString();
	PaginationSupport paginationSupport = (PaginationSupport) request.getAttribute("paginationSupport");
	List<TVoteEstimated> estimatedLists = paginationSupport.getItems();
	String pageNoStr = request.getParameter("pageNo");
	if (pageNoStr == null)pageNoStr = "0";
	Integer pageNo = Integer.valueOf(pageNoStr);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>粮油集团办公自动化协作平台</title>
		<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" />
		<style>
			body {
				font-size: 11px;
				font-family: Verdana, Arial, Helvetica, sans-serif;
			}
			a {
				color: #000;
				text-decoration: none;
			}
			.img {
				border: 0px;
			}
			.black_overlays {
				display: none;
				position: absolute;
				top: 0%;
				left: 0%;
				width: 100%;
				height: 900px;
				background-color: gray;
				z-index: 1001;
				-moz-opacity: 0.8;
				opacity: .80;
				filter: alpha(opacity = 80);
			}
			.list_01 {
				display: none;
				position: absolute;
				top: 25%;
				left: 10%;
				width: 500px;
				height: 150px;
				border: 16px solid #FFF;
				border-bottom: none;
				background-color: white;
				z-index: 1002;
				overflow: auto;
			}
			.list_01 li {
				width: 117px;
				float: left
			}
			.tree {
				display: none;
				position: absolute;
				top: 25%;
				left: 35%;
				width: 255px;
				height: 235px;
				border: 16px solid #FFF;
				border-bottom: none;
				background-color: white;
				z-index: 1002;
				overflow: auto;
			}
		</style>
		<script type="text/javascript">
			function submitpages(value){
				if(value==-1){
					alert("请重新选择页码!");
					return ;
				}
				var urls=location.href;
				if(urls.indexOf('pageNo=')==-1){
					if(urls.indexOf('?')==-1){//wucan
						window.location.href=urls+'?pageNo='+value;
					}else{
						window.location.href=urls+'&pageNo='+value;
					}
				}else{
					urls=urls.substring(0,urls.indexOf('pageNo=')+7)+value;
					window.location.href=urls;
				}
			}
			
			var headIdStrong;
			var estimatedStrong;
			function openType(headId,estimated){
				headIdStrong=headId;
				estimatedStrong=estimated
				document.getElementById('lightRole').style.display='block';
				document.getElementById('fade').style.display='block';
			}
			function closeType(){
				document.getElementById('lightRole').style.display='none';
				document.getElementById('fade').style.display='none';
			}
			function selectType(conformation,parentId){
				window.open("<%=basePath%>tjsinfo/tjsoa/vote/voteCake.do?headId="+headIdStrong+"&estimated="+estimatedStrong+"&conformationId="+conformation+"&parentId="+parentId);
			}
		</script>
	</head>
	<body>
		<div id="rightindex" style="height:97%">
			<div id="tab" style="width:100%">
				<!--导航开始处-->
				<div id="indextit">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="30" style="padding-bottom: 4px;">
								<img src="<%=basePath%>images/1234.gif" />
							</td>
							<td valign="middle">
								个人数据汇总

							</td>
						</tr>
					</table>
				</div>
				<!--这里开始是显示、隐藏的内容-->
				<div id="index_main">
					<div class="draft_list">
						<ul>
							<%
								String name = "";
								int i = 0;
								for (TVoteEstimated estimatedList : estimatedLists) {
									i++;
									if (i % 7 == 0)out.print("</ul><ul>");
									name = estimatedList.getName();
									if (name.length() > 56)name = ds.substring(name, 56);
							%>
							<li>
								<%=name%>
								<span>
								   <font color="blue">
								      <a onclick="openType('<%=estimatedList.getHeadId()%>','<%=estimatedList.getId()%>')" style="cursor: hand"><font color="blue">汇总图表</font></a>
								   </font>
								</span>
							</li>
							<%
								}
							%>
						</ul>
					</div>
					<div class="page">
						共<%=paginationSupport.getTotalCount()%>条,共<%=paginationSupport.getPageCount()%>页&nbsp;&nbsp;
						当前为第<%=pageNo + 1%>页&nbsp;&nbsp;
						<%
							if (paginationSupport.getStartIndex() > 1) {
						%>
						<a onclick="submitpages('<%=pageNo - 1%>')" style="cursor: hand">上一页</a>
						<%
							}
						%>
						<%
							if (paginationSupport.getStartIndex()
									+ paginationSupport.getPageSize() < paginationSupport
									.getTotalCount()) {
						%>
						<a onclick="submitpages('<%=pageNo + 1%>')" style="cursor: hand">下一页</a>
						<%
							}
						%>
						&nbsp;&nbsp; 跳转到

						<select name="selectPage" id="selectPage"
							onchange="submitpages(this.value)">
							<option value="0">
								--跳转--
							</option>
							<%
								for (int pi = 0; pi < paginationSupport.getPageCount(); pi++) {
							%>
							<option value="<%=pi%>"><%=pi + 1%></option>
							<%
								}
							%>
						</select>
						页

					</div>
					<div id="lightRole" class="list_01">
						<%
							List<TVoteConformation> conformationLists = (List) request.getAttribute("conformationLists");
							for (TVoteConformation conformationList : conformationLists) {
						%>
						<a onclick="selectType('<%=conformationList.getId()%>','<%=conformationList.getParentId()%>')" style="cursor: hand"><%=conformationList.getName()%></a>
						<br />
						<%
							}
						%>
						<hr />
						<a style="cursor: hand" onclick="closeType()">取消</a>
					</div>
					<div id="fade" class="black_overlays"></div>
					<a href="<%=basePath%>tjsinfo/tjsoa/vote/voteHeadList.do?target=one"><font color="blue">返回</font></a>
					<div class="clear"></div>
				</div>
			</div>
		</div>
	</body>
</html>